package cn.itcast.com.IO.zifuliu.introduction;

import java.io.*;

public class reader {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("D:\\代码\\代码\\代码\\cn\\itcast\\com\\IO\\a.txt");
        Reader reader = new InputStreamReader(fileInputStream);
        FileInputStream fileInputStream1 = new FileInputStream("D:\\代码\\代码\\代码\\cn\\itcast\\com\\IO\\a.txt");
        Reader reader1 = new InputStreamReader(fileInputStream1);
//        char[] bytes = new char[1024];
//        reader.read(bytes);
//        System.out.println(bytes);
//        int readerChar;
//        while ((readerChar = reader.read())!= -1){
//            char a = (char) readerChar;
//            System.out.print(a);
//        }

//        int len;
//        char[] charBuf = new char[1024];
//        while ((len = reader.read(charBuf)) != -1){
//            String s = new String(charBuf,0,len);
//            System.out.println(s);
//        }
        int len;
        char[] charBuf = new char[1024];
        int offset = 5;
        while ((len = reader.read(charBuf)) != -1){
            String s = new String(charBuf,0,charBuf.length - offset);
            System.out.println(s);
        }

        reader.close();


    }
}
